<div class="container-fluid">
    <div class="row-fluid">
        <div class="span3">
            <?php echo $this->partial('choix/menu.phtml', array('num_vente' => $this->num_vente));?>
            <!--/.well -->
        </div>
        <!--/span-->
        <div class="span9">
            <div class="wrap">
                <div id="main-content">
                    <?php if ( $this->org == "all" || $this->org == "arc") :?>
                    <div class="top-link">
                        <a href="<?php echo $this->baseUrl()?>/admin/clients/search-email?org=<?php echo $this->org ?>&num_vente=<?php echo $this->num_vente ?>">Recherche email</a> -
                        <a href="<?php echo $this->baseUrl()?>/admin/clients/add?org=<?php echo $this->org ?>&num_vente=<?php echo $this->num_vente ?>">Ajouter un client</a> -
                        <!--<a href="#" onclick="voir('fiche_client_pdf','','<?php echo $this->org ?>','','<?php echo $this->num_vente ?>')">Fichier PDF</a> -  
                        <a href="#" onclick="voir('client_csv','','<?php echo $this->org ?>','','<?php echo $this->num_vente ?>')">Fichier CSV</a> -   -->
                        <a href="<?php echo $this->baseUrl()?>/admin/clients?org=new&num_vente=<?php echo $this->num_vente ?>">Nouveaux clients</a> -
                        <a href="<?php echo $this->baseUrl()?>/admin/clients?org=arc&num_vente=<?php echo $this->num_vente ?>">Clients archivés</a>
                    </div>
                    <?php else : ?>
                    <div class="top-link"><a href="<?php echo $this->baseUrl()?>/admin/clients?num_vente=<?php echo $this->num_vente ?>">Tous les clients</a></div>
                    <?php endif; ?>
                    <table>
                        <thead style="width:100%">
                            <tr>
                                <th>N° </th>
                                <th style="text-align:left">Nom </th>
                                <th style="text-align:left">Prénom</th>
                                <th>Editer</th>
                                <th>Supprimer</th>
                                <th>PDF</th>
                                <th>Codes</th>
                                <th>A confirmé</th>
                                <th>Est validé</th>
                             </tr>
                        </thead>
                        <tfoot>
                            <tr>
                                <td colspan="10">
                                    <?php if(count($this->paginator) > 1) :?>
                                        <?php echo $this->paginationControl($this->paginator, 'Sliding', '_pagination.phtml'); ?>
                                    <?php endif;?>
                                    <!-- End .pagination -->

                                    <div class="clear"></div>
                               </td>
                            </tr>
                        </tfoot>
                        <tbody style="width:100%">
                        <?php  foreach($this->paginator as $row):
                            $date = new DateTime($row['dtdemandevalid']);
                        ?>
                            <tr>
                                <td><a name="<?php echo $row['p_clients']?>"></a>
                                    <?php echo (stripslashes($row['num_client']) != "n")?(int)$row['num_client']:"n"?>
                                </td>
                                <td style="text-align:left"><?php echo stripslashes($row['nom']) ?></td>
                                <td style="text-align:left"><?php echo stripslashes($row['prenom'])?></td>
                                <td><a href="<?php echo $this->baseUrl()?>/admin/clients/edit?num=<?php echo $row['p_clients']?>&org=<?php echo $this->org ?>&num_vente=<?php echo $this->num_vente?>"><img src="<?php echo $this->baseUrl()?>/images/pencil.png" border="0" alt="Editer" title="Editer"></a></td> 
                                <td><a class="delete-item" href="<?php echo $this->baseUrl()?>/admin/clients/delete?num=<?php echo $row['p_clients']?>&org=<?php echo $this->org ?>&num_vente=<?php echo $this->num_vente?>&page=<?php echo $this->page ?>"><img src="<?php echo $this->baseUrl()?>/images/cross.png" border="0" alt="Supprimer" title="Supprimer"></a></td>
                                <td><a href="<?php echo '#'.$row['p_clients']?>" onclick="voir('fiche_client_pdf','<?php echo $row['p_clients']?>','','','<?php echo $this->num_vente?>')"><img src="<?php echo $this->baseUrl()?>/images/pdf.gif" border="0" alt="PDF" title="PDF"></a></td>
                                <td>
                                <?php if ($row['email'] != null):?>
                                    <a href="<?php echo '#'.$row['p_clients']?>" onclick="voir('envoicode','<?php echo $row['p_clients']?>,'','','<?php echo $this->num_vente?>')"><img src="<?php echo $this->baseUrl()?>/images/mail_forward.png" border="0" alt="Envoi des codes" title="Envoi des codes"></a>
                                <?php endif;?>
                                </td>

                                <td>
                                <?php if ($row['dtconfirm'] == "") :?>
                                    <img src="<?php echo $this->baseUrl()?>/images/0.png">
                                <?php else :?>
                                    <img src="<?php echo $this->baseUrl()?>/images/1.png">
                                <?php endif;?>
                                </td>
                                <td>
                                <?php if ($row['dtvalid'] == "") :?>
                                    <?php if ($row['dtdemandevalid'] == "") :?>
                                        <img src="<?php echo $this->baseUrl()?>/images/0.png">
                                    <?php else :?>
                                        <?php $d = $date->format('d/m/Y');?>
                                        <img src="<?php echo $this->baseUrl()?>/images/warning.png" title="Demande de validation le <?php echo $d;?>">
                                    <?php endif;?>
                                <?php else :?>
                                    <img src="<?php echo $this->baseUrl()?>/images/1.png">
                                <?php endif;?>
                                </td>
                            </tr>
                         <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <!--/row-->
        </div>
        <!--/span-->
    </div>
    <!--/row-->
</div>